Optimal. Leaf size=90 \[ \frac {a (c+d x)^4}{4 d}+\frac {6 b d^2 (c+d x) \cos (e+f x)}{f^3}-\frac {b (c+d x)^3 \cos (e+f x)}{f}-\frac {6 b d^3 \sin (e+f x)}{f^4}+\frac {3 b d (c+d x)^2 \sin (e+f x)}{f^2} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.08, antiderivative size = 90, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 3, integrand size = 18, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {3398, 3377,
2717} \begin {gather*} \frac {a (c+d x)^4}{4 d}+\frac {6 b d^2 (c+d x) \cos (e+f x)}{f^3}+\frac {3 b d (c+d x)^2 \sin (e+f x)}{f^2}-\frac {b (c+d x)^3 \cos (e+f x)}{f}-\frac {6 b d^3 \sin (e+f x)}{f^4} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2717
Rule 3377
Rule 3398
Rubi steps
\begin {align*} \int (c+d x)^3 (a+b \sin (e+f x)) \, dx &=\int \left (a (c+d x)^3+b (c+d x)^3 \sin (e+f x)\right ) \, dx\\ &=\frac {a (c+d x)^4}{4 d}+b \int (c+d x)^3 \sin (e+f x) \, dx\\ &=\frac {a (c+d x)^4}{4 d}-\frac {b (c+d x)^3 \cos (e+f x)}{f}+\frac {(3 b d) \int (c+d x)^2 \cos (e+f x) \, dx}{f}\\ &=\frac {a (c+d x)^4}{4 d}-\frac {b (c+d x)^3 \cos (e+f x)}{f}+\frac {3 b d (c+d x)^2 \sin (e+f x)}{f^2}-\frac {\left (6 b d^2\right ) \int (c+d x) \sin (e+f x) \, dx}{f^2}\\ &=\frac {a (c+d x)^4}{4 d}+\frac {6 b d^2 (c+d x) \cos (e+f x)}{f^3}-\frac {b (c+d x)^3 \cos (e+f x)}{f}+\frac {3 b d (c+d x)^2 \sin (e+f x)}{f^2}-\frac {\left (6 b d^3\right ) \int \cos (e+f x) \, dx}{f^3}\\ &=\frac {a (c+d x)^4}{4 d}+\frac {6 b d^2 (c+d x) \cos (e+f x)}{f^3}-\frac {b (c+d x)^3 \cos (e+f x)}{f}-\frac {6 b d^3 \sin (e+f x)}{f^4}+\frac {3 b d (c+d x)^2 \sin (e+f x)}{f^2}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.24, size = 124, normalized size = 1.38 \begin {gather*} \frac {1}{4} a x \left (4 c^3+6 c^2 d x+4 c d^2 x^2+d^3 x^3\right )-\frac {b (c+d x) \left (c^2 f^2+2 c d f^2 x+d^2 \left (-6+f^2 x^2\right )\right ) \cos (e+f x)}{f^3}+\frac {3 b d \left (c^2 f^2+2 c d f^2 x+d^2 \left (-2+f^2 x^2\right )\right ) \sin (e+f x)}{f^4} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(481\) vs.
\(2(88)=176\).
time = 0.06, size = 482, normalized size = 5.36
method | result | size |
risch | \(\frac {a \,d^{3} x^{4}}{4}+a \,d^{2} c \,x^{3}+\frac {3 a d \,c^{2} x^{2}}{2}+a \,c^{3} x +\frac {a \,c^{4}}{4 d}-\frac {b \left (d^{3} f^{2} x^{3}+3 c \,d^{2} f^{2} x^{2}+3 c^{2} d \,f^{2} x +c^{3} f^{2}-6 d^{3} x -6 c \,d^{2}\right ) \cos \left (f x +e \right )}{f^{3}}+\frac {3 b d \left (d^{2} x^{2} f^{2}+2 c d \,f^{2} x +c^{2} f^{2}-2 d^{2}\right ) \sin \left (f x +e \right )}{f^{4}}\) | \(153\) |
norman | \(\frac {\frac {\left (a \,c^{3} f^{3}-3 b \,c^{2} d \,f^{2}+6 b \,d^{3}\right ) x}{f^{3}}+\frac {\left (2 b \,c^{3} f^{2}-12 c \,d^{2} b \right ) \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{f^{3}}+\frac {d^{2} \left (a c f -b d \right ) x^{3}}{f}+\frac {\left (a \,c^{3} f^{3}+3 b \,c^{2} d \,f^{2}-6 b \,d^{3}\right ) x \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{f^{3}}+\frac {d^{2} \left (a c f +b d \right ) x^{3} \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{f}+\frac {a \,d^{3} x^{4}}{4}+\frac {a \,d^{3} x^{4} \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{4}+\frac {6 b d \left (c^{2} f^{2}-2 d^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{f^{4}}+\frac {6 b \,d^{3} x^{2} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{f^{2}}+\frac {3 c d \left (a c f -2 b d \right ) x^{2}}{2 f}+\frac {3 c d \left (a c f +2 b d \right ) x^{2} \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{2 f}+\frac {12 c \,d^{2} b x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{f^{2}}}{1+\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )}\) | \(317\) |
derivativedivides | \(\frac {a \,c^{3} \left (f x +e \right )-\frac {3 a \,c^{2} d e \left (f x +e \right )}{f}+\frac {3 a \,c^{2} d \left (f x +e \right )^{2}}{2 f}+\frac {3 a c \,d^{2} e^{2} \left (f x +e \right )}{f^{2}}-\frac {3 a c \,d^{2} e \left (f x +e \right )^{2}}{f^{2}}+\frac {a c \,d^{2} \left (f x +e \right )^{3}}{f^{2}}-\frac {a \,d^{3} e^{3} \left (f x +e \right )}{f^{3}}+\frac {3 a \,d^{3} e^{2} \left (f x +e \right )^{2}}{2 f^{3}}-\frac {a \,d^{3} e \left (f x +e \right )^{3}}{f^{3}}+\frac {a \,d^{3} \left (f x +e \right )^{4}}{4 f^{3}}-b \,c^{3} \cos \left (f x +e \right )+\frac {3 b \,c^{2} d e \cos \left (f x +e \right )}{f}+\frac {3 b \,c^{2} d \left (\sin \left (f x +e \right )-\left (f x +e \right ) \cos \left (f x +e \right )\right )}{f}-\frac {3 b c \,d^{2} e^{2} \cos \left (f x +e \right )}{f^{2}}-\frac {6 b c \,d^{2} e \left (\sin \left (f x +e \right )-\left (f x +e \right ) \cos \left (f x +e \right )\right )}{f^{2}}+\frac {3 b c \,d^{2} \left (-\left (f x +e \right )^{2} \cos \left (f x +e \right )+2 \cos \left (f x +e \right )+2 \left (f x +e \right ) \sin \left (f x +e \right )\right )}{f^{2}}+\frac {b \,d^{3} e^{3} \cos \left (f x +e \right )}{f^{3}}+\frac {3 b \,d^{3} e^{2} \left (\sin \left (f x +e \right )-\left (f x +e \right ) \cos \left (f x +e \right )\right )}{f^{3}}-\frac {3 b \,d^{3} e \left (-\left (f x +e \right )^{2} \cos \left (f x +e \right )+2 \cos \left (f x +e \right )+2 \left (f x +e \right ) \sin \left (f x +e \right )\right )}{f^{3}}+\frac {b \,d^{3} \left (-\left (f x +e \right )^{3} \cos \left (f x +e \right )+3 \left (f x +e \right )^{2} \sin \left (f x +e \right )-6 \sin \left (f x +e \right )+6 \left (f x +e \right ) \cos \left (f x +e \right )\right )}{f^{3}}}{f}\) | \(482\) |
default | \(\frac {a \,c^{3} \left (f x +e \right )-\frac {3 a \,c^{2} d e \left (f x +e \right )}{f}+\frac {3 a \,c^{2} d \left (f x +e \right )^{2}}{2 f}+\frac {3 a c \,d^{2} e^{2} \left (f x +e \right )}{f^{2}}-\frac {3 a c \,d^{2} e \left (f x +e \right )^{2}}{f^{2}}+\frac {a c \,d^{2} \left (f x +e \right )^{3}}{f^{2}}-\frac {a \,d^{3} e^{3} \left (f x +e \right )}{f^{3}}+\frac {3 a \,d^{3} e^{2} \left (f x +e \right )^{2}}{2 f^{3}}-\frac {a \,d^{3} e \left (f x +e \right )^{3}}{f^{3}}+\frac {a \,d^{3} \left (f x +e \right )^{4}}{4 f^{3}}-b \,c^{3} \cos \left (f x +e \right )+\frac {3 b \,c^{2} d e \cos \left (f x +e \right )}{f}+\frac {3 b \,c^{2} d \left (\sin \left (f x +e \right )-\left (f x +e \right ) \cos \left (f x +e \right )\right )}{f}-\frac {3 b c \,d^{2} e^{2} \cos \left (f x +e \right )}{f^{2}}-\frac {6 b c \,d^{2} e \left (\sin \left (f x +e \right )-\left (f x +e \right ) \cos \left (f x +e \right )\right )}{f^{2}}+\frac {3 b c \,d^{2} \left (-\left (f x +e \right )^{2} \cos \left (f x +e \right )+2 \cos \left (f x +e \right )+2 \left (f x +e \right ) \sin \left (f x +e \right )\right )}{f^{2}}+\frac {b \,d^{3} e^{3} \cos \left (f x +e \right )}{f^{3}}+\frac {3 b \,d^{3} e^{2} \left (\sin \left (f x +e \right )-\left (f x +e \right ) \cos \left (f x +e \right )\right )}{f^{3}}-\frac {3 b \,d^{3} e \left (-\left (f x +e \right )^{2} \cos \left (f x +e \right )+2 \cos \left (f x +e \right )+2 \left (f x +e \right ) \sin \left (f x +e \right )\right )}{f^{3}}+\frac {b \,d^{3} \left (-\left (f x +e \right )^{3} \cos \left (f x +e \right )+3 \left (f x +e \right )^{2} \sin \left (f x +e \right )-6 \sin \left (f x +e \right )+6 \left (f x +e \right ) \cos \left (f x +e \right )\right )}{f^{3}}}{f}\) | \(482\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 498 vs.
\(2 (92) = 184\).
time = 0.30, size = 498, normalized size = 5.53 \begin {gather*} \frac {4 \, {\left (f x + e\right )} a c^{3} + \frac {{\left (f x + e\right )}^{4} a d^{3}}{f^{3}} + \frac {4 \, {\left (f x + e\right )}^{3} a c d^{2}}{f^{2}} + \frac {6 \, {\left (f x + e\right )}^{2} a c^{2} d}{f} - 4 \, b c^{3} \cos \left (f x + e\right ) - \frac {4 \, {\left (f x + e\right )}^{3} a d^{3} e}{f^{3}} - \frac {12 \, {\left (f x + e\right )}^{2} a c d^{2} e}{f^{2}} - \frac {12 \, {\left (f x + e\right )} a c^{2} d e}{f} + \frac {12 \, b c^{2} d \cos \left (f x + e\right ) e}{f} - \frac {12 \, {\left ({\left (f x + e\right )} \cos \left (f x + e\right ) - \sin \left (f x + e\right )\right )} b c^{2} d}{f} + \frac {6 \, {\left (f x + e\right )}^{2} a d^{3} e^{2}}{f^{3}} + \frac {12 \, {\left (f x + e\right )} a c d^{2} e^{2}}{f^{2}} - \frac {12 \, b c d^{2} \cos \left (f x + e\right ) e^{2}}{f^{2}} + \frac {24 \, {\left ({\left (f x + e\right )} \cos \left (f x + e\right ) - \sin \left (f x + e\right )\right )} b c d^{2} e}{f^{2}} - \frac {12 \, {\left ({\left ({\left (f x + e\right )}^{2} - 2\right )} \cos \left (f x + e\right ) - 2 \, {\left (f x + e\right )} \sin \left (f x + e\right )\right )} b c d^{2}}{f^{2}} - \frac {4 \, {\left (f x + e\right )} a d^{3} e^{3}}{f^{3}} + \frac {4 \, b d^{3} \cos \left (f x + e\right ) e^{3}}{f^{3}} - \frac {12 \, {\left ({\left (f x + e\right )} \cos \left (f x + e\right ) - \sin \left (f x + e\right )\right )} b d^{3} e^{2}}{f^{3}} + \frac {12 \, {\left ({\left ({\left (f x + e\right )}^{2} - 2\right )} \cos \left (f x + e\right ) - 2 \, {\left (f x + e\right )} \sin \left (f x + e\right )\right )} b d^{3} e}{f^{3}} - \frac {4 \, {\left ({\left ({\left (f x + e\right )}^{3} - 6 \, f x - 6 \, e\right )} \cos \left (f x + e\right ) - 3 \, {\left ({\left (f x + e\right )}^{2} - 2\right )} \sin \left (f x + e\right )\right )} b d^{3}}{f^{3}}}{4 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.35, size = 170, normalized size = 1.89 \begin {gather*} \frac {a d^{3} f^{4} x^{4} + 4 \, a c d^{2} f^{4} x^{3} + 6 \, a c^{2} d f^{4} x^{2} + 4 \, a c^{3} f^{4} x - 4 \, {\left (b d^{3} f^{3} x^{3} + 3 \, b c d^{2} f^{3} x^{2} + b c^{3} f^{3} - 6 \, b c d^{2} f + 3 \, {\left (b c^{2} d f^{3} - 2 \, b d^{3} f\right )} x\right )} \cos \left (f x + e\right ) + 12 \, {\left (b d^{3} f^{2} x^{2} + 2 \, b c d^{2} f^{2} x + b c^{2} d f^{2} - 2 \, b d^{3}\right )} \sin \left (f x + e\right )}{4 \, f^{4}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 264 vs.
\(2 (88) = 176\).
time = 0.25, size = 264, normalized size = 2.93 \begin {gather*} \begin {cases} a c^{3} x + \frac {3 a c^{2} d x^{2}}{2} + a c d^{2} x^{3} + \frac {a d^{3} x^{4}}{4} - \frac {b c^{3} \cos {\left (e + f x \right )}}{f} - \frac {3 b c^{2} d x \cos {\left (e + f x \right )}}{f} + \frac {3 b c^{2} d \sin {\left (e + f x \right )}}{f^{2}} - \frac {3 b c d^{2} x^{2} \cos {\left (e + f x \right )}}{f} + \frac {6 b c d^{2} x \sin {\left (e + f x \right )}}{f^{2}} + \frac {6 b c d^{2} \cos {\left (e + f x \right )}}{f^{3}} - \frac {b d^{3} x^{3} \cos {\left (e + f x \right )}}{f} + \frac {3 b d^{3} x^{2} \sin {\left (e + f x \right )}}{f^{2}} + \frac {6 b d^{3} x \cos {\left (e + f x \right )}}{f^{3}} - \frac {6 b d^{3} \sin {\left (e + f x \right )}}{f^{4}} & \text {for}\: f \neq 0 \\\left (a + b \sin {\left (e \right )}\right ) \left (c^{3} x + \frac {3 c^{2} d x^{2}}{2} + c d^{2} x^{3} + \frac {d^{3} x^{4}}{4}\right ) & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 5.80, size = 157, normalized size = 1.74 \begin {gather*} \frac {1}{4} \, a d^{3} x^{4} + a c d^{2} x^{3} + \frac {3}{2} \, a c^{2} d x^{2} + a c^{3} x - \frac {{\left (b d^{3} f^{3} x^{3} + 3 \, b c d^{2} f^{3} x^{2} + 3 \, b c^{2} d f^{3} x + b c^{3} f^{3} - 6 \, b d^{3} f x - 6 \, b c d^{2} f\right )} \cos \left (f x + e\right )}{f^{4}} + \frac {3 \, {\left (b d^{3} f^{2} x^{2} + 2 \, b c d^{2} f^{2} x + b c^{2} d f^{2} - 2 \, b d^{3}\right )} \sin \left (f x + e\right )}{f^{4}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.80, size = 191, normalized size = 2.12 \begin {gather*} \frac {a\,d^3\,x^4}{4}-\frac {3\,\sin \left (e+f\,x\right )\,\left (2\,b\,d^3-b\,c^2\,d\,f^2\right )}{f^4}-\frac {\cos \left (e+f\,x\right )\,\left (b\,c^3\,f^2-6\,b\,c\,d^2\right )}{f^3}+a\,c^3\,x+\frac {3\,x\,\cos \left (e+f\,x\right )\,\left (2\,b\,d^3-b\,c^2\,d\,f^2\right )}{f^3}+\frac {3\,a\,c^2\,d\,x^2}{2}+a\,c\,d^2\,x^3-\frac {b\,d^3\,x^3\,\cos \left (e+f\,x\right )}{f}+\frac {3\,b\,d^3\,x^2\,\sin \left (e+f\,x\right )}{f^2}+\frac {6\,b\,c\,d^2\,x\,\sin \left (e+f\,x\right )}{f^2}-\frac {3\,b\,c\,d^2\,x^2\,\cos \left (e+f\,x\right )}{f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________